# 导包
from selenium.webdriver import ChromeOptions
from selenium.webdriver.chrome.options import Options
# 隐藏浏览器界面
chrome_option = Options()
chrome_option.add_argument('--headless')
chrome_option.add_argument('--disable-gpu')
# 防止检测
option = ChromeOptions()
option.add_experimental_option('excludeSwitches', ['enable-automation'])
# 导入配置
driver = webdriver.Chrome(executable_path='./chromedriver.exe', chrome_options=chrome_option, options=option)
selenium隐藏浏览器界面并防止检测
最新推荐文章于 2024-05-17 15:12:59 发布